<template>
  <div id="app">
    <router-view />
    <van-tabbar route v-model="active" active-color="red" inactive-color="#000">
      <van-tabbar-item icon="wap-home-o" name="home" to="/home">首页</van-tabbar-item>
      <van-tabbar-item icon="shopping-cart-o" name="cart" :badge="cartNum" to="/cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="user-circle-o" name="my" dot to="/my">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
  computed:{
    ...mapGetters(['cartNum'])
  },
  data(){
    return {
      active:'home'
    }
  }
};
</script>
<style lang="scss">
</style>
